package com.example.device.api

import com.example.common.view.api.BaseApiService
import com.example.device.entity.DeviceEntityItem
import com.example.device.entity.DeviceOrderAddParam
import com.example.device.entity.DeviceOrderEntityItem
import com.example.device.entity.DeviceParam
import com.example.device.entity.MaintainEntity
import com.example.device.entity.PollingEntity
import com.example.device.model.DeviceResultData
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface DeviceApiService:BaseApiService {
    @GET("/api/devices")
    suspend fun getDevice():DeviceResultData<List<DeviceEntityItem>>
    @POST("/api/devices")
    suspend fun addDevice(@Body deviceParam: DeviceParam):DeviceResultData<DeviceEntityItem>
    @GET("/api/inspection-orders")
    suspend fun getDeviceOrder():DeviceResultData<List<DeviceOrderEntityItem>>
    @GET("/api/inspection-orders/{id}")
    suspend fun getDeviceOrderXiang(@Path("id")id:Int):DeviceResultData<DeviceOrderEntityItem>
    @PATCH("/api/inspection-orders/start/{id}")
    suspend fun startInspection(@Path("id")id:Int):DeviceResultData<DeviceOrderEntityItem>
    @PATCH("/api/inspection-orders/transfer/{id}")
    suspend fun transferInspection(@Path("id")id:Int,@Query("inspector")inspector:String):DeviceResultData<DeviceOrderEntityItem>
    @POST("/api/inspection-orders")
    suspend fun getDeviceOrderAdd(@Body deviceOrderAddParam: DeviceOrderAddParam):DeviceResultData<DeviceOrderEntityItem>
    @GET("/api/repair-orders")
    suspend fun getMaintain():DeviceResultData<List<MaintainEntity>>
    @POST("/api/repair-orders")
    suspend fun postMaintain(@Body maintainEntity: MaintainEntity):DeviceResultData<MaintainEntity>
    @GET("/api/inspection-orders")
    suspend fun getPolling():DeviceResultData<List<PollingEntity>>
    @POST("/api/inspection-orders")
    suspend fun postPolling(@Body pollingEntity: PollingEntity):DeviceResultData<PollingEntity>

}